package com.android.happymall.view.group;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.android.happymall.R;
import com.android.happymall.utils.ObjectUtils;


public class BannerItemFragment extends Fragment {
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";
    private static final String ARG_PARAM3 = "param3";
    private String mParam1;
    private int mParam2;
    private String mParam3;


    public static BannerItemFragment newInstance(String thumb, int photolength, String link) {
        BannerItemFragment fragment = new BannerItemFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, thumb);
        args.putInt(ARG_PARAM2, photolength);
        args.putString(ARG_PARAM3, link);
        fragment.setArguments(args);
        return fragment;
    }

    public BannerItemFragment() {

    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getInt(ARG_PARAM2);
            mParam3 = getArguments().getString(ARG_PARAM3);


        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.item_fragment_banner, null);
        ImageView iv = (ImageView) view.findViewById(R.id.imageView1);
        ObjectUtils.photo2(getActivity(), mParam1, iv);
        iv.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

            }
        });

        return view;
    }



}
